import { BblPart } from "../entity/part.entity";
import { AttachDto } from "./att.dto";

export class PartCreateDto {
  partMainName: string;
  partSubName: string;
  partPrice: number;
  attId: string;
}

export class PartPageQueryDto {
  partMainName: string;
  partSubName: string;
  pageSize: number;
  current: number;
}

export class PartDto {
  constructor(part: BblPart) {
    this.partId = part.partId;
    this.partMainName = part.partMainName;
    this.partSubName = part.partSubName;
    this.partPrice = part.partPrice;
    this.partImg = new AttachDto(part.partImg);
    this.createAt = new Date(part.createAt).valueOf();
  }

  partId: string;
  partMainName: string;
  partSubName: string;
  partPrice: number;
  partImg: AttachDto;
  createAt: number;
}
